
#ifndef TIMER_H_
#define TIMER_H_

namespace p2 {

class Timer
{
public:
	Timer(bool createStarted);
	virtual ~Timer();

	void start();
	void stop();

	real64 getElapsedTimeInSec();
	real64 getElapsedTimeInMilliSec();
	real64 getElapsedTimeInMicroSec();

private:
	bool _stopped;
#ifdef _WIN32
	LARGE_INTEGER _frequency;
	LARGE_INTEGER _startCount;
	LARGE_INTEGER _endCount;
#else
	timeval _startCount;
	timeval _endCount;
#endif
};

}

#endif //TIMER_H_
